package com.peaksport.pkms.permit.controller;

import javax.ws.rs.core.MediaType;

import org.apache.servicecomb.provider.rest.common.RestSchema;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.peaksport.framework.base.controller.BaseController;
import com.peaksport.pkms.oauth.vo.TokenVO;

@RestSchema(schemaId ="pkms-permit-org")
@RequestMapping(value="org", produces = MediaType.APPLICATION_JSON)

public class OrgImpl extends BaseController {

	@GetMapping("/test")
	public String getOrgByRelation() {
		return "hello test";
	}
	@GetMapping("/session")
	public String getTestSession() {
		ResponseEntity<String> tokenVo = restTemplate.getForEntity("cse://pkms-test/test/testRedis/sessionId", String.class);
		return tokenVo.getBody();
	}

}
